import initTranslations from '../i18n';
import ExampleClientComponent from '@/components/ExampleClientComponent';
import TranslationsProvider from '@/components/TranslationsProvider';
import LanguageChanger from '@/components/LanguageChanger';
const i18nNamespaces = ['login', 'register'];

export default async function Home({ params }: Readonly<{
  params: Promise<{ locale: string }>
}>) {
  const { locale } = await params
  const { t, resources } = await initTranslations(locale, i18nNamespaces);

  return (
    <TranslationsProvider
      namespaces={i18nNamespaces}
      locale={locale}
      resources={resources}>
      <main>
        <h1>{t('10575374-3a11-458e-b88e-f9dcd66702b5', '默认值')}</h1>
        <ExampleClientComponent />
        <LanguageChanger />
      </main>
    </TranslationsProvider>
  );
}